package com.icim.exception;

import org.apache.commons.lang.exception.NestableException;

import com.mysql.jdbc.Util;

public class LoadMainException extends NestableException implements
		java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Long lRc;
	private String errorMessage;
	private Throwable cause;

	public Long getlRc() {
		return lRc;
	}

	public void setlRc(Long lRc) {
		this.lRc = lRc;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public Throwable getCause() {
		return cause;
	}

	public void setCause(Throwable cause) {
		this.cause = cause;
	}

	@Override
	public String toString() {
		if (this.getCause() == null) {
			return "LoadMainException [lRc=" + lRc + ", errorMessage="
					+ errorMessage + "]";
		}
		return "LoadMainException [lRc=" + lRc + ", errorMessage="
				+ errorMessage + ", cause=" + Util.stackTraceToString(cause)
				+ "]";
	}

	public LoadMainException(long lRc, String errorMessage, Throwable cause) {
		super(errorMessage, cause);
		this.setlRc(lRc);
		this.setErrorMessage(errorMessage);
		this.setCause(cause);
	}

	public LoadMainException(long lRc, String errorMessage) {
		super(errorMessage);
		this.setlRc(lRc);
		this.setErrorMessage(errorMessage);
	}

}
